package cn.tsoft.utils;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

public class StreamUtils {
 
	public static byte[] readInputStream(InputStream inputStream)throws Exception{
		ByteArrayOutputStream outStream = new ByteArrayOutputStream();
		byte[] buffer = new byte[1024];
		int len = 0;
		if((len=inputStream.read(buffer))!=-1){
			outStream.write(buffer, 0, len);
		}
		inputStream.close();
		return outStream.toByteArray();
	}
}
